/*
 * @Author: Kingsley
 * @Date: 2019-03-30 21:50:36
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 22019-03-30 21:50:36
 * 备忘录的service实现
 */

import _axios from "@/utils/requestUtil";
import _urlConfig from "@/config/stars/MemoURLConfig";

class Memo {

  /**
   * 添加备忘录信息
   * @param {} requestParam 
   * {
   *  fkCategoryId:种类id
      priority: 权重
      name: 标题
      description: 描述
      expectTime: 期望完成时间
   * }
   */
  add(requestParam) {
    return _axios.request({
      url: _urlConfig.addMemo,
      data: requestParam,
      method: "post"
    });
  }

  /**
   * 搜索备忘录信息
   * @param {} requestParam 
   * {
   * pageNum：页数
   * pageSize：页面大小；默认为50条
   * searchTime：搜索时间
   * status：备忘录状态：0：全部；1：代办；2：进行中；3：完成
   * }
   */
  searchMemo(requestParam){
    return _axios.request({
      url: _urlConfig.searchMemo,
      data: requestParam,
      method: "post"
    });
  }

  /**
   * 编辑备忘录
   * @param {*} requestParam 
   * {
   *  id: 主键id
   *  fkCategoryId:种类id
      priority: 权重
      name: 标题
      description: 描述
      expectTime: 期望完成时间
   * }
   */
  editMemo(requestParam) {
    return _axios.request({
      url: _urlConfig.editMemo,
      data: requestParam,
      method: "post"
    });
  }

  /**
   * 结束备忘录
   * @param {*} requestParam 
   * {
   *  id：主键id
   * }
   */
  finish(requestParam){
    return _axios.request({
      url: _urlConfig.finish,
      data: requestParam,
      method: "post"
    });
  }

}
export default Memo;
